Namespace - LJCDataAccess
Parameters
scriptFileSpec - The script file specification.
Syntax
C# |
public Void ExecuteScript(String scriptFileSpec)
|
Executes a DB script file.
(E)
Example
C# |
private static void ExecuteScript(DataAccess dataAccess)
{
StringBuilder builder = new StringBuilder(64);
builder.AppendLine("insert into TestTable values('Name1');");
builder.AppendLine("go");
builder.AppendLine("delete from TestTable where Name = 'Name1';");
builder.AppendLine("go");
string scriptText = builder.ToString();
File.WriteAllText("TestScript.sql", scriptText);
dataAccess.ExecuteScript("TestScript.sql");
}
|
Copyright © Lester J. Clark and Contributors.
Licensed under the MIT License.